***Fortin-Rittberger
***replication commands for Jessica Fortin-Rittberger. 2016. "Cross-national gender-gaps in political knowledge: how much is due to context?"
*** Political Research Quarterly
***file #2 of 2. merged dataset operations 
***use with merged file only!

***data file submitted is a merged data file of Modules 1-3 of the CSES and prepared merged variables (full variable prepration available by
***demand please email j.fortin-rittberger@sbg.ac.at)

*FIGURE 1 Additive distribution of correct responses to three political information items by gender
twoway (histogram Z3036_1b if Z2002==1, percent discrete start(0) color(green)) ///
       (histogram Z3036_1b if Z2002==2, percent discrete start(0) ///
	       fcolor(none) lcolor(black)), legend(order(1 "male" 2 "Female" ))

		   
*FIGURE 2 Additive distribution of the number of �don�t know� to three political information items, by gender
*remove module 1 since there is no DK!
twoway (histogram Z3036_2b if Z2002==1 & Z1001~=1, percent discrete start(0) color(green)) ///
       (histogram Z3036_2b if Z2002==2 & Z1001~=1, percent discrete start(0) ///
	       fcolor(none) lcolor(black)), legend(order(1 "male" 2 "Female" ))

*FIGURE 3 Distribution of men and women on three factual political knowledge scales using CSES Modules 1-3.
 graph dot (mean) Z3036_1b (mean) Z3036_2b (mean) Z3036_3b, over(Z2002)		   
 
*FIGURE 4 Distribution of the size of the gender-gap on the positive knowledge scale, in 107 post-election surveys between 1996-2011. 
*commands located in macro operations file!

*TABLE 1 OLS Regression models estimating the aggregate size of the gender gap in political knowledge
*commands located in macro operations file!


*TABLE 2 Multilevel mixed-effects ordered logistic regressions estimating additive political knowledge scores in individuals 
***NOTE: some covariates require changing the sign due to inverse coding!! removal of module 1 in model 99999, LSQ<27 removes Albania 2005

meologit Z3036_1b ib0.female Z2001 Z2003 Z2020 Z3000 Z3001 Z3020 Z3021 womeninparliament i.Z1023 ib1.Qstructure ib0.womencontent macro_Z3036 i.Z_Qcontent lsq effnv dm_ksLOG  female#c.womeninparliament female#womencontent female#c.macro_Z3036 female#Z_Qcontent female#Qstructure female#c.lsq female#c.effnv female#c.dm_ksLOG if lsq<27 || Z1003:, intpoints(10)  intmethod(mcaghermite) vce(cluster Z1003)
estimates store e77777, title(Model 77777)

meologit Z3036_3b ib0.female Z2001 Z2003 Z2020 Z3000 Z3001 Z3020 Z3021 womeninparliament i.Z1023 ib1.Qstructure ib0.womencontent macro_Z3036 i.Z_Qcontent lsq effnv dm_ksLOG  female#c.womeninparliament female#womencontent female#c.macro_Z3036 female#Z_Qcontent female#Qstructure female#c.lsq female#c.effnv female#c.dm_ksLOG if lsq<27 || Z1003:, intpoints(10)  intmethod(mcaghermite) vce(cluster Z1003)
estimates store e88888, title(Model 88888)

meologit Z3036_2b ib0.female Z2001 Z2003 Z2020 Z3000 Z3001 Z3020 Z3021 womeninparliament i.Z1023 ib1.Qstructure ib0.womencontent macro_Z3036 i.Z_Qcontent lsq effnv dm_ksLOG  female#c.womeninparliament female#womencontent female#c.macro_Z3036  female#Z1023 female#c.lsq female#c.effnv female#c.dm_ksLOG if A1003==. & lsq<27 || Z1003:, intpoints(10) iterate(20)  intmethod(mcaghermite) vce(cluster Z1003)
estimates store e99999, title(Model 99999)


esttab  _est_e77777 _est_e88888 _est_e99999 using ///
"TABLE11.rtf", ///
cells(b(star fmt(3)) se(par fmt(2))) ///
legend label title(Multilevel mixed-effects ordered logistic regressions estimating additive political knowledge scores in individuals ) ///
nonumbers mtitles("Model 77777" ///
  "Model 88888" "Model 99999" ) ///
star(* 0.10 ** 0.05 *** 0.01) r2 replace
